#include "app_message.h"
#include "log/log.h"

int main(int argc, char const *argv[])
{
    // 准备一个字符串
    //char *json_str = "{\"conn_type\":1,\"id\":\"5858\",\"msg\":\"61626364\"}";
    char *json_str = "{\"conn_type\":1,\"id\":\"5858\",\"msg\":\"61626364\"}";
    // 将字符串转换为字符数组
    char chars_buff[100];
    int buff_len = app_message_JsonStrToChars(json_str, chars_buff, sizeof(chars_buff));
    log_info("转换后的字符数组为:%.*s,len=%d", buff_len, chars_buff, buff_len);

    // 将字符数组转换为字符串
    char *json_str2 = app_message_CharsToJsonStr(chars_buff, buff_len);
    log_info("JSON_Str = %s", json_str2);

    return 0;
}
